<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>相册列表 - 社交平台</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome 图标 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
    
    <style>
        :root {
            --primary: #4f46e5;
            --primary-light: #818cf8;
            --primary-dark: #3730a3;
            --secondary: #ec4899;
            --success: #10b981;
            --warning: #f59e0b;
            --danger: #ef4444;
            --text-primary: #111827;
            --text-secondary: #6b7280;
            --text-light: #9ca3af;
            --bg-light: #f9fafb;
            --bg-white: #ffffff;
            --border-light: #e5e7eb;
            --border-medium: #d1d5db;
            --radius: 10px;
            --shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
            --transition: all 0.3s ease;
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            background-color: var(--bg-light);
            color: var(--text-primary);
            padding-top: 56px;
            padding-bottom: 65px;
        }
        
        /* 顶部导航 */
        .top-nav {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 56px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 16px;
            z-index: 1000;
            border-bottom: 1px solid var(--border-light);
            box-shadow: 0 1px 3px rgba(0,0,0,0.05);
        }
        
        .nav-title {
            font-size: 1.15rem;
            font-weight: 600;
        }
        
        .nav-actions {
            display: flex;
            gap: 16px;
            font-size: 1.25rem;
        }
        
        .nav-btn {
            background: none;
            border: none;
            color: var(--text-secondary);
            cursor: pointer;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--transition);
        }
        
        .nav-btn:hover {
            background-color: var(--bg-light);
            color: var(--primary);
        }
        
        /* 搜索栏 */
        .search-container {
            padding: 12px 16px;
            background-color: var(--bg-white);
            border-bottom: 1px solid var(--border-light);
        }
        
        .search-group {
            position: relative;
            display: flex;
            align-items: center;
        }
        
        .search-input {
            flex: 1;
            padding: 11px 16px 11px 44px;
            border-radius: 24px;
            border: 1px solid var(--border-light);
            font-size: 0.9rem;
            background-color: var(--bg-light);
            transition: var(--transition);
        }
        
        .search-input:focus {
            outline: none;
            border-color: var(--primary-light);
            box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
        }
        
        .search-icon {
            position: absolute;
            left: 14px;
            color: var(--text-light);
        }
        
        .search-filter-btn {
            margin-left: 8px;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            border: 1px solid var(--border-light);
            background-color: var(--bg-white);
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--transition);
        }
        
        .search-filter-btn:hover {
            border-color: var(--primary-light);
            color: var(--primary);
        }
        
        /* 筛选面板 */
        .filters-panel {
            background-color: var(--bg-white);
            border-bottom: 1px solid var(--border-light);
            overflow: hidden;
        }
        
        /* 筛选标签栏 */
        .filter-tabs {
            display: flex;
            padding: 8px 16px;
            background-color: var(--bg-white);
            overflow-x: auto;
            scrollbar-width: none;
            border-bottom: 1px solid var(--border-light);
        }
        
        .filter-tabs::-webkit-scrollbar {
            display: none;
        }
        
        .filter-tab {
            padding: 6px 16px;
            border-radius: 18px;
            font-size: 0.9rem;
            white-space: nowrap;
            margin-right: 8px;
            color: var(--text-secondary);
            cursor: pointer;
            transition: var(--transition);
        }
        
        .filter-tab.active {
            background-color: var(--primary);
            color: white;
        }
        
        .filter-tab:hover:not(.active) {
            background-color: var(--bg-light);
        }
        
        /* 高级筛选区域 */
        .advanced-filters {
            padding: 12px 16px;
            border-bottom: 1px solid var(--border-light);
        }
        
        .filter-section {
            margin-bottom: 14px;
        }
        
        .filter-title {
            font-size: 0.9rem;
            font-weight: 600;
            margin-bottom: 8px;
            color: var(--text-primary);
        }
        
        /* 日期筛选 */
        .date-filter {
            display: flex;
            gap: 8px;
        }
        
        .date-btn {
            flex: 1;
            padding: 8px 0;
            text-align: center;
            border-radius: 8px;
            border: 1px solid var(--border-light);
            font-size: 0.85rem;
            color: var(--text-secondary);
            background-color: var(--bg-white);
            transition: var(--transition);
        }
        
        .date-btn.active {
            border-color: var(--primary);
            color: var(--primary);
            background-color: rgba(79, 70, 229, 0.05);
        }
        
        /* 标签筛选 */
        .tags-filter {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }
        
        .tag {
            padding: 5px 12px;
            border-radius: 16px;
            font-size: 0.85rem;
            border: 1px solid var(--border-light);
            color: var(--text-secondary);
            background-color: var(--bg-white);
            transition: var(--transition);
        }
        
        .tag.active {
            border-color: var(--secondary);
            color: var(--secondary);
            background-color: rgba(236, 72, 153, 0.05);
        }
        
        /* 视图切换 */
        .view-controls {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 16px;
            background-color: var(--bg-white);
            border-bottom: 1px solid var(--border-light);
        }
        
        .view-label {
            font-size: 0.9rem;
            color: var(--text-secondary);
        }
        
        .view-buttons {
            display: flex;
            gap: 8px;
        }
        
        .view-btn {
            width: 36px;
            height: 36px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            background-color: var(--bg-light);
            border: none;
            color: var(--text-secondary);
            transition: var(--transition);
        }
        
        .view-btn.active {
            background-color: var(--primary);
            color: white;
        }
        
        .view-btn:hover:not(.active) {
            background-color: #e9e7fd;
            color: var(--primary);
        }
        
        /* 相册容器 */
        .albums-container {
            padding: 12px;
        }
        
        .results-info {
            font-size: 0.85rem;
            color: var(--text-secondary);
            margin-bottom: 12px;
            padding: 0 4px;
        }
        
        /* 网格布局 */
        .albums-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
        }
        
        /* 列表布局 */
        .albums-list {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        
        /* 瀑布流布局 */
        .albums-masonry {
            column-count: 2;
            column-gap: 12px;
        }
        
        .masonry-item {
            break-inside: avoid;
            margin-bottom: 12px;
        }
        
        /* 相册卡片基础样式 */
        .album-card {
            background-color: var(--bg-white);
            border-radius: var(--radius);
            overflow: hidden;
            box-shadow: var(--shadow);
            transition: var(--transition);
            text-decoration: none;
            color: var(--text-primary);
        }
        
        .album-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
        }
        
        /* 网格布局卡片 */
        .album-card.grid {
            display: flex;
            flex-direction: column;
        }
        
        /* 列表布局卡片 */
        .album-card.list {
            display: flex;
            height: 130px;
        }
        
        /* 相册封面 */
        .album-cover {
            position: relative;
            overflow: hidden;
        }
        
        .album-cover.grid {
            width: 100%;
            aspect-ratio: 1;
        }
        
        .album-cover.list {
            width: 130px;
            height: 100%;
            flex-shrink: 0;
        }
        
        .album-image {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.4s ease;
        }
        
        .album-card:hover .album-image {
            transform: scale(1.07);
        }
        
        .image-count {
            position: absolute;
            bottom: 8px;
            right: 8px;
            background-color: rgba(0, 0, 0, 0.6);
            color: white;
            font-size: 0.8rem;
            padding: 2px 8px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            gap: 4px;
        }
        
        .album-tags {
            position: absolute;
            top: 8px;
            left: 8px;
            display: flex;
            gap: 4px;
        }
        
        .album-tag {
            background-color: rgba(0, 0, 0, 0.6);
            color: white;
            font-size: 0.7rem;
            padding: 1px 6px;
            border-radius: 10px;
        }
        
        /* 相册信息 */
        .album-info {
            padding: 10px 12px;
        }
        
        .album-info.grid {
            flex: 1;
            display: flex;
            flex-direction: column;
        }
        
        .album-info.list {
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }
        
        .album-title {
            font-weight: 600;
            font-size: 0.95rem;
            margin-bottom: 4px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        .album-meta {
            display: flex;
            align-items: center;
            font-size: 0.8rem;
            color: var(--text-secondary);
        }
        
        .album-meta.grid {
            margin-top: auto;
        }
        
        .album-date {
            display: flex;
            align-items: center;
            gap: 4px;
        }
        
        .album-actions {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-left: auto;
        }
        
        .album-action {
            display: flex;
            align-items: center;
            gap: 4px;
            color: var(--text-secondary);
            transition: var(--transition);
        }
        
        .album-action:hover {
            color: var(--primary);
        }
        
        .album-likes.liked {
            color: var(--secondary);
        }
        
        /* 筛选器展开/收起按钮 */
        .filter-toggle {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            padding: 8px 0;
            background-color: var(--bg-white);
            border: none;
            color: var(--text-secondary);
            font-size: 0.9rem;
            cursor: pointer;
            transition: var(--transition);
        }
        
        .filter-toggle:hover {
            color: var(--primary);
        }
        
        .filter-toggle i {
            margin-left: 6px;
            transition: transform 0.3s ease;
        }
        
        .filter-toggle.collapsed i {
            transform: rotate(180deg);
        }
        
        /* 底部导航 */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 65px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-around;
            align-items: center;
            border-top: 1px solid var(--border-light);
            z-index: 1000;
            box-shadow: 0 -1px 3px rgba(0,0,0,0.05);
        }
        
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            color: var(--text-secondary);
            font-size: 0.7rem;
            text-decoration: none;
            transition: var(--transition);
        }
        
        .nav-item i {
            font-size: 1.25rem;
            margin-bottom: 4px;
        }
        
        .nav-item.active {
            color: var(--primary);
        }
        
        /* 创建相册按钮 */
        .create-btn {
            position: fixed;
            bottom: 80px;
            right: 16px;
            width: 52px;
            height: 52px;
            border-radius: 50%;
            background-color: var(--primary);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
            z-index: 999;
            transition: var(--transition);
            border: none;
        }
        
        .create-btn:hover {
            transform: scale(1.05);
            box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
        }
        
        /* 空状态 */
        .empty-state {
            padding: 60px 20px;
            text-align: center;
            color: var(--text-light);
        }
        
        .empty-state i {
            font-size: 60px;
            margin-bottom: 15px;
            color: #e5e7eb;
        }
        
        .empty-state p {
            margin-bottom: 20px;
        }
        
        .empty-state button {
            padding: 8px 16px;
            border-radius: 8px;
            background-color: var(--primary);
            color: white;
            border: none;
            font-size: 0.9rem;
            transition: var(--transition);
        }
        
        .empty-state button:hover {
            background-color: var(--primary-dark);
        }
        
        /* 加载中状态 */
        .loading-state {
            padding: 40px 20px;
            text-align: center;
        }
        
        .spinner {
            width: 40px;
            height: 40px;
            border: 4px solid #f3f3f3;
            border-top: 4px solid var(--primary);
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 auto 15px;
        }
        
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
    </style>
</head>
<body>
    <!-- 顶部导航 -->
    <div class="top-nav">
        <button class="nav-btn">
            <i class="fas fa-arrow-left"></i>
        </button>
        <div class="nav-title">我的相册</div>
        <div class="nav-actions">
            <button class="nav-btn">
                <i class="far fa-bell"></i>
            </button>
            <button class="nav-btn">
                <i class="far fa-cog"></i>
            </button>
        </div>
    </div>
    
    <!-- 搜索栏 -->
    <div class="search-container">
        <div class="search-group">
            <i class="fas fa-search search-icon"></i>
            <input type="text" class="search-input" placeholder="搜索相册或标签...">
            <button class="search-filter-btn" id="advancedFilterBtn">
                <i class="fas fa-filter"></i>
            </button>
        </div>
    </div>
    
    <!-- 筛选面板 -->
    <div class="filters-panel">
        <!-- 分类筛选标签 -->
        <div class="filter-tabs">
            <div class="filter-tab active" data-category="all">全部相册</div>
            <div class="filter-tab" data-category="personal">个人相册</div>
            <div class="filter-tab" data-category="shared">共享相册</div>
            <div class="filter-tab" data-category="event">活动相册</div>
            <div class="filter-tab" data-category="travel">旅行相册</div>
            <div class="filter-tab" data-category="food">美食相册</div>
            <div class="filter-tab" data-category="nature">自然风景</div>
            <div class="filter-tab" data-category="portrait">人物写真</div>
        </div>
        
        <!-- 高级筛选区域 -->
        <div class="advanced-filters" id="advancedFilters">
            <!-- 日期筛选 -->
            <div class="filter-section">
                <div class="filter-title">按日期筛选</div>
                <div class="date-filter">
                    <button class="date-btn active" data-date="all">全部时间</button>
                    <button class="date-btn" data-date="week">本周</button>
                    <button class="date-btn" data-date="month">本月</button>
                    <button class="date-btn" data-date="year">今年</button>
                </div>
            </div>
            
            <!-- 标签筛选 -->
            <div class="filter-section">
                <div class="filter-title">按标签筛选</div>
                <div class="tags-filter">
                    <div class="tag active" data-tag="all">全部标签</div>
                    <div class="tag" data-tag="friends">朋友</div>
                    <div class="tag" data-tag="family">家人</div>
                    <div class="tag" data-tag="vacation">假期</div>
                    <div class="tag" data-tag="party">聚会</div>
                    <div class="tag" data-tag="work">工作</div>
                    <div class="tag" data-tag="pet">宠物</div>
                    <div class="tag" data-tag="city">城市</div>
                </div>
            </div>
        </div>
        
        <!-- 筛选展开/收起按钮 -->
        <button class="filter-toggle collapsed" id="filterToggle">
            展开筛选
            <i class="fas fa-chevron-down"></i>
        </button>
        
        <!-- 视图控制 -->
        <div class="view-controls">
            <div class="view-label" id="resultsCount">找到 12 个相册</div>
            <div class="view-buttons">
                <button class="view-btn active" data-view="grid" title="网格视图">
                    <i class="fas fa-th"></i>
                </button>
                <button class="view-btn" data-view="list" title="列表视图">
                    <i class="fas fa-list"></i>
                </button>
                <button class="view-btn" data-view="masonry" title="瀑布流视图">
                    <i class="fas fa-th-large"></i>
                </button>
            </div>
        </div>
    </div>
    
    <!-- 相册列表容器 -->
    <div class="albums-container">
        <div class="albums-content albums-grid" id="albumsContent">
            <!-- 相册内容将通过JS动态生成 -->
        </div>
    </div>
    
    <!-- 创建相册按钮 -->
    <button class="create-btn">
        <i class="fas fa-plus"></i>
    </button>
    
    <!-- 底部导航 -->
    <div class="bottom-nav">
        <a href="#" class="nav-item">
            <i class="fas fa-home"></i>
            <span>首页</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-compass"></i>
            <span>发现</span>
        </a>
        <a href="#" class="nav-item active">
            <i class="fas fa-images"></i>
            <span>相册</span>
        </a>
        <a href="#" class="nav-item">
            <i class="far fa-comment"></i>
            <span>消息</span>
        </a>
        <a href="#" class="nav-item">
            <i class="far fa-user"></i>
            <span>我的</span>
        </a>
    </div>
    
    <!-- Bootstrap JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        // 相册数据
        const albums = [
            {
                id: 1,
                title: "夏日海边旅行",
                cover: "https://picsum.photos/id/10/600/600",
                date: "2023-07-15",
                count: 24,
                likes: 32,
                category: "travel",
                tags: ["vacation", "friends"],
                aspectRatio: 1
            },
            {
                id: 2,
                title: "25岁生日派对",
                cover: "https://picsum.photos/id/20/600/600",
                date: "2023-06-10",
                count: 18,
                likes: 56,
                category: "event",
                tags: ["party", "friends"],
                aspectRatio: 1
            },
            {
                id: 3,
                title: "山间徒步探险",
                cover: "https://picsum.photos/id/29/600/900",
                date: "2023-05-28",
                count: 36,
                likes: 48,
                category: "nature",
                tags: ["vacation", "friends"],
                aspectRatio: 0.67
            },
            {
                id: 4,
                title: "城市美食探索",
                cover: "https://picsum.photos/id/431/600/400",
                date: "2023-04-15",
                count: 29,
                likes: 27,
                category: "food",
                tags: ["city", "friends"],
                aspectRatio: 1.5
            },
            {
                id: 5,
                title: "我家毛孩子的日常",
                cover: "https://picsum.photos/id/237/600/600",
                date: "2023-03-20",
                count: 42,
                likes: 89,
                category: "personal",
                tags: ["pet"],
                aspectRatio: 1
            },
            {
                id: 6,
                title: "新项目启动仪式",
                cover: "https://picsum.photos/id/42/600/400",
                date: "2023-02-18",
                count: 15,
                likes: 12,
                category: "shared",
                tags: ["work"],
                aspectRatio: 1.5
            },
            {
                id: 7,
                title: "春节家庭聚会",
                cover: "https://picsum.photos/id/64/600/600",
                date: "2023-01-22",
                count: 22,
                likes: 67,
                category: "event",
                tags: ["family", "party"],
                aspectRatio: 1
            },
            {
                id: 8,
                title: "城市建筑摄影",
                cover: "https://picsum.photos/id/416/600/900",
                date: "2022-12-05",
                count: 31,
                likes: 43,
                category: "personal",
                tags: ["city"],
                aspectRatio: 0.67
            },
            {
                id: 9,
                title: "秋季红叶采风",
                cover: "https://picsum.photos/id/137/600/400",
                date: "2022-11-12",
                count: 19,
                likes: 35,
                category: "nature",
                tags: ["vacation"],
                aspectRatio: 1.5
            },
            {
                id: 10,
                title: "大学同学聚会",
                cover: "https://picsum.photos/id/338/600/600",
                date: "2022-10-01",
                count: 27,
                likes: 51,
                category: "shared",
                tags: ["friends", "party"],
                aspectRatio: 1
            },
            {
                id: 11,
                title: "个人艺术写真",
                cover: "https://picsum.photos/id/646/600/900",
                date: "2022-09-18",
                count: 16,
                likes: 78,
                category: "portrait",
                tags: ["personal"],
                aspectRatio: 0.67
            },
            {
                id: 12,
                title: "公司团建活动",
                cover: "https://picsum.photos/id/325/600/400",
                date: "2022-08-25",
                count: 34,
                likes: 29,
                category: "shared",
                tags: ["work", "friends"],
                aspectRatio: 1.5
            }
        ];
        
        // 当前筛选条件
        let currentFilters = {
            category: "all",
            date: "all",
            tag: "all",
            search: ""
        };
        
        // 当前视图类型
        let currentView = "grid";
        
        // DOM元素
        const albumsContent = document.getElementById("albumsContent");
        const filterTabs = document.querySelectorAll(".filter-tab");
        const dateButtons = document.querySelectorAll(".date-btn");
        const tagButtons = document.querySelectorAll(".tag");
        const viewButtons = document.querySelectorAll(".view-btn");
        const filterToggle = document.getElementById("filterToggle");
        const advancedFilters = document.getElementById("advancedFilters");
        const searchInput = document.querySelector(".search-input");
        const resultsCount = document.getElementById("resultsCount");
        const advancedFilterBtn = document.getElementById("advancedFilterBtn");
        
        // 初始化页面
        function init() {
            renderAlbums();
            setupEventListeners();
        }
        
        // 设置事件监听器
        function setupEventListeners() {
            // 分类筛选
            filterTabs.forEach(tab => {
                tab.addEventListener("click", () => {
                    filterTabs.forEach(t => t.classList.remove("active"));
                    tab.classList.add("active");
                    currentFilters.category = tab.getAttribute("data-category");
                    renderAlbums();
                });
            });
            
            // 日期筛选
            dateButtons.forEach(btn => {
                btn.addEventListener("click", () => {
                    dateButtons.forEach(b => b.classList.remove("active"));
                    btn.classList.add("active");
                    currentFilters.date = btn.getAttribute("data-date");
                    renderAlbums();
                });
            });
            
            // 标签筛选
            tagButtons.forEach(tag => {
                tag.addEventListener("click", () => {
                    tagButtons.forEach(t => t.classList.remove("active"));
                    tag.classList.add("active");
                    currentFilters.tag = tag.getAttribute("data-tag");
                    renderAlbums();
                });
            });
            
            // 视图切换
            viewButtons.forEach(btn => {
                btn.addEventListener("click", () => {
                    viewButtons.forEach(b => b.classList.remove("active"));
                    btn.classList.add("active");
                    currentView = btn.getAttribute("data-view");
                    renderAlbums();
                });
            });
            
            // 筛选展开/收起
            filterToggle.addEventListener("click", () => {
                advancedFilters.classList.toggle("d-none");
                filterToggle.classList.toggle("collapsed");
                
                if (filterToggle.classList.contains("collapsed")) {
                    filterToggle.innerHTML = "展开筛选 <i class='fas fa-chevron-down'></i>";
                } else {
                    filterToggle.innerHTML = "收起筛选 <i class='fas fa-chevron-down'></i>";
                }
            });
            
            // 搜索功能
            searchInput.addEventListener("input", () => {
                currentFilters.search = searchInput.value.toLowerCase().trim();
                renderAlbums();
            });
            
            // 高级筛选按钮
            advancedFilterBtn.addEventListener("click", () => {
                advancedFilters.classList.toggle("d-none");
                filterToggle.classList.toggle("collapsed");
                
                if (filterToggle.classList.contains("collapsed")) {
                    filterToggle.innerHTML = "展开筛选 <i class='fas fa-chevron-down'></i>";
                } else {
                    filterToggle.innerHTML = "收起筛选 <i class='fas fa-chevron-down'></i>";
                }
            });
            
            // 创建相册按钮
            document.querySelector(".create-btn").addEventListener("click", () => {
                alert("创建新相册功能将在这里实现");
            });
        }
        
        // 筛选相册
        function filterAlbums() {
            return albums.filter(album => {
                // 类别筛选
                if (currentFilters.category !== "all" && album.category !== currentFilters.category) {
                    return false;
                }
                
                // 标签筛选
                if (currentFilters.tag !== "all" && !album.tags.includes(currentFilters.tag)) {
                    return false;
                }
                
                // 日期筛选
                if (currentFilters.date !== "all") {
                    const albumDate = new Date(album.date);
                    const now = new Date();
                    const oneWeekAgo = new Date(now - 7 * 24 * 60 * 60 * 1000);
                    const oneMonthAgo = new Date(now.getFullYear(), now.getMonth() - 1, now.getDate());
                    const oneYearAgo = new Date(now.getFullYear() - 1, now.getMonth(), now.getDate());
                    
                    if (currentFilters.date === "week" && albumDate < oneWeekAgo) return false;
                    if (currentFilters.date === "month" && albumDate < oneMonthAgo) return false;
                    if (currentFilters.date === "year" && albumDate < oneYearAgo) return false;
                }
                
                // 搜索筛选
                if (currentFilters.search && 
                    !album.title.toLowerCase().includes(currentFilters.search) &&
                    !album.tags.some(tag => tag.includes(currentFilters.search))) {
                    return false;
                }
                
                return true;
            });
        }
        
        // 渲染相册
        function renderAlbums() {
            // 清空容器
            albumsContent.innerHTML = "";
            
            // 应用筛选
            const filteredAlbums = filterAlbums();
            
            // 更新结果计数
            resultsCount.textContent = `找到 ${filteredAlbums.length} 个相册`;
            
            // 处理空状态
            if (filteredAlbums.length === 0) {
                albumsContent.innerHTML = `
                    <div class="empty-state">
                        <i class="fas fa-images"></i>
                        <p>没有找到符合条件的相册</p>
                        <button id="resetFilters">重置筛选条件</button>
                    </div>
                `;
                
                // 重置筛选按钮事件
                document.getElementById("resetFilters").addEventListener("click", resetFilters);
                return;
            }
            
            // 设置视图类型
            albumsContent.className = `albums-content albums-${currentView}`;
            
            // 渲染相册
            filteredAlbums.forEach(album => {
                // 创建相册卡片
                const albumCard = document.createElement("a");
                albumCard.className = `album-card ${currentView}`;
                albumCard.href = "#"; // 实际应用中会链接到相册详情页
                
                // 构建标签HTML
                const tagsHtml = album.tags.map(tag => 
                    `<span class="album-tag">${tag}</span>`
                ).join("");
                
                // 根据视图类型设置不同的卡片结构
                if (currentView === "list") {
                    albumCard.innerHTML = `
                        <div class="album-cover ${currentView}">
                            <img src="${album.cover}" alt="${album.title}" class="album-image">
                            <div class="image-count">
                                <i class="fas fa-images"></i>
                                <span>${album.count}</span>
                            </div>
                            <div class="album-tags">
                                ${tagsHtml}
                            </div>
                        </div>
                        <div class="album-info ${currentView}">
                            <div class="album-title">${album.title}</div>
                            <div class="album-meta ${currentView}">
                                <div class="album-date">
                                    <i class="far fa-calendar"></i>
                                    <span>${album.date}</span>
                                </div>
                                <div class="album-actions">
                                    <div class="album-action album-likes ${album.likes > 30 ? 'liked' : ''}">
                                        <i class="${album.likes > 30 ? 'fas' : 'far'} fa-heart"></i>
                                        <span>${album.likes}</span>
                                    </div>
                                    <div class="album-action">
                                        <i class="far fa-comment"></i>
                                        <span>${Math.floor(album.likes / 3)}</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    `;
                } else {
                    // 网格和瀑布流视图共用的结构
                    let cardContent = `
                        <div class="album-cover ${currentView}" style="aspect-ratio: ${album.aspectRatio}">
                            <img src="${album.cover}" alt="${album.title}" class="album-image">
                            <div class="image-count">
                                <i class="fas fa-images"></i>
                                <span>${album.count}</span>
                            </div>
                            <div class="album-tags">
                                ${tagsHtml}
                            </div>
                        </div>
                        <div class="album-info ${currentView}">
                            <div class="album-title">${album.title}</div>
                            <div class="album-meta ${currentView}">
                                <div class="album-date">
                                    <i class="far fa-calendar"></i>
                                    <span>${album.date}</span>
                                </div>
                                <div class="album-action album-likes ${album.likes > 30 ? 'liked' : ''}">
                                    <i class="${album.likes > 30 ? 'fas' : 'far'} fa-heart"></i>
                                    <span>${album.likes}</span>
                                </div>
                            </div>
                        </div>
                    `;
                    
                    // 瀑布流视图需要额外的容器
                    if (currentView === "masonry") {
                        const masonryItem = document.createElement("div");
                        masonryItem.className = "masonry-item";
                        albumCard.innerHTML = cardContent;
                        masonryItem.appendChild(albumCard);
                        albumsContent.appendChild(masonryItem);
                    } else {
                        albumCard.innerHTML = cardContent;
                        albumsContent.appendChild(albumCard);
                    }
                }
                
                // 阻止默认链接行为
                albumCard.addEventListener("click", (e) => {
                    e.preventDefault();
                    alert(`打开相册: ${album.title}`);
                });
                
                // 点赞按钮事件
                const likeBtn = albumCard.querySelector(".album-likes");
                likeBtn.addEventListener("click", (e) => {
                    e.stopPropagation();
                    const icon = likeBtn.querySelector("i");
                    const countEl = likeBtn.querySelector("span");
                    let count = parseInt(countEl.textContent);
                    
                    if (icon.classList.contains("far")) {
                        icon.classList.remove("far");
                        icon.classList.add("fas");
                        countEl.textContent = count + 1;
                        likeBtn.classList.add("liked");
                    } else {
                        icon.classList.remove("fas");
                        icon.classList.add("far");
                        countEl.textContent = count - 1;
                        if (count - 1 <= 30) {
                            likeBtn.classList.remove("liked");
                        }
                    }
                });
            });
        }
        
        // 重置筛选条件
        function resetFilters() {
            currentFilters = {
                category: "all",
                date: "all",
                tag: "all",
                search: ""
            };
            
            // 更新UI
            filterTabs.forEach(t => t.classList.remove("active"));
            document.querySelector('.filter-tab[data-category="all"]').classList.add("active");
            
            dateButtons.forEach(b => b.classList.remove("active"));
            document.querySelector('.date-btn[data-date="all"]').classList.add("active");
            
            tagButtons.forEach(t => t.classList.remove("active"));
            document.querySelector('.tag[data-tag="all"]').classList.add("active");
            
            searchInput.value = "";
            
            // 重新渲染
            renderAlbums();
        }
        
        // 初始化
        document.addEventListener("DOMContentLoaded", init);
    </script>
</body>
</html>
